// $ANTLR 3.1.2 D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g 2009-06-01 11:44:10

package org.protege.owl.examples.tab.grammar;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

public class FOLStage1Parser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "NEWLINE", "WS", "DOT", "ID", "INT", "COMA", "COLON", "SEMICOLON", "HYPHEN"
    };
    public static final int COLON=10;
    public static final int WS=5;
    public static final int NEWLINE=4;
    public static final int HYPHEN=12;
    public static final int SEMICOLON=11;
    public static final int INT=8;
    public static final int DOT=6;
    public static final int ID=7;
    public static final int COMA=9;
    public static final int EOF=-1;

    // delegates
    // delegators


        public FOLStage1Parser(TokenStream input) {
            this(input, new RecognizerSharedState());
        }
        public FOLStage1Parser(TokenStream input, RecognizerSharedState state) {
            super(input, state);
             
        }
        

    public String[] getTokenNames() { return FOLStage1Parser.tokenNames; }
    public String getGrammarFileName() { return "D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g"; }



    // $ANTLR start "stat"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g:13:1: stat returns [String cleanVal] : ( NEWLINE | WS )* ( item ( NEWLINE | WS )* )* DOT ;
    public final String stat() throws RecognitionException {
        String cleanVal = null;

        FOLStage1Parser.item_return item1 = null;



        		cleanVal ="";
        	
        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g:18:2: ( ( NEWLINE | WS )* ( item ( NEWLINE | WS )* )* DOT )
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g:19:2: ( NEWLINE | WS )* ( item ( NEWLINE | WS )* )* DOT
            {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g:19:2: ( NEWLINE | WS )*
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( ((LA1_0>=NEWLINE && LA1_0<=WS)) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g:
            	    {
            	    if ( (input.LA(1)>=NEWLINE && input.LA(1)<=WS) ) {
            	        input.consume();
            	        state.errorRecovery=false;
            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        throw mse;
            	    }


            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);

            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g:19:18: ( item ( NEWLINE | WS )* )*
            loop3:
            do {
                int alt3=2;
                int LA3_0 = input.LA(1);

                if ( ((LA3_0>=ID && LA3_0<=HYPHEN)) ) {
                    alt3=1;
                }


                switch (alt3) {
            	case 1 :
            	    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g:19:19: item ( NEWLINE | WS )*
            	    {
            	    pushFollow(FOLLOW_item_in_stat48);
            	    item1=item();

            	    state._fsp--;

            	    cleanVal+=(item1!=null?input.toString(item1.start,item1.stop):null);
            	    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g:19:49: ( NEWLINE | WS )*
            	    loop2:
            	    do {
            	        int alt2=2;
            	        int LA2_0 = input.LA(1);

            	        if ( ((LA2_0>=NEWLINE && LA2_0<=WS)) ) {
            	            alt2=1;
            	        }


            	        switch (alt2) {
            	    	case 1 :
            	    	    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g:
            	    	    {
            	    	    if ( (input.LA(1)>=NEWLINE && input.LA(1)<=WS) ) {
            	    	        input.consume();
            	    	        state.errorRecovery=false;
            	    	    }
            	    	    else {
            	    	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	    	        throw mse;
            	    	    }


            	    	    }
            	    	    break;

            	    	default :
            	    	    break loop2;
            	        }
            	    } while (true);

            	    cleanVal+=" ";

            	    }
            	    break;

            	default :
            	    break loop3;
                }
            } while (true);

            match(input,DOT,FOLLOW_DOT_in_stat65); 
            cleanVal+=".";

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return cleanVal;
    }
    // $ANTLR end "stat"

    public static class item_return extends ParserRuleReturnScope {
    };

    // $ANTLR start "item"
    // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g:22:1: item : ( ID | INT | COMA | COLON | SEMICOLON | HYPHEN ) ;
    public final FOLStage1Parser.item_return item() throws RecognitionException {
        FOLStage1Parser.item_return retval = new FOLStage1Parser.item_return();
        retval.start = input.LT(1);

        try {
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g:23:2: ( ( ID | INT | COMA | COLON | SEMICOLON | HYPHEN ) )
            // D:\\Projekty\\Protege4Workspace\\org.protege.editor.owl.examples.tab\\src\\org\\protege\\owl\\examples\\tab\\grammar\\FOLStage1.g:24:2: ( ID | INT | COMA | COLON | SEMICOLON | HYPHEN )
            {
            if ( (input.LA(1)>=ID && input.LA(1)<=HYPHEN) ) {
                input.consume();
                state.errorRecovery=false;
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

            retval.stop = input.LT(-1);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "item"

    // Delegated rules


 

    public static final BitSet FOLLOW_set_in_stat38 = new BitSet(new long[]{0x0000000000001FF0L});
    public static final BitSet FOLLOW_item_in_stat48 = new BitSet(new long[]{0x0000000000001FF0L});
    public static final BitSet FOLLOW_set_in_stat52 = new BitSet(new long[]{0x0000000000001FF0L});
    public static final BitSet FOLLOW_DOT_in_stat65 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_item79 = new BitSet(new long[]{0x0000000000000002L});

}